import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

import java.util.Arrays;
import java.util.Collection;

import static org.junit.Assert.assertEquals;

@RunWith(Parameterized.class)
public class TriangleTest_03 {
        private int input1;
        private int input2;
        private int input3;
        private String type;

        public TriangleTest_03(int input1, int input2, int input3, String type) {
            this.input1 = input1;
            this.input2 = input2;
            this.input3 = input3;
            this.type = type;
        }


        @Parameterized.Parameters
        public static Collection TriangleData() {
            Object[][] object = {{50, 50, 0, "输入错误"}, {50, 50, 1, "等腰三角形"}, {50, 50, 2, "等腰三角形"}, {50, 50, 50, "等边三角形"},
                    {50, 50, 99, "等腰三角形"}, {50, 50, 100, "非三角形"}, {50, 50, 101, "输入错误"}, {50, 0, 50, "输入错误"},
                    {50, 1, 50, "等腰三角形"}, {50, 2, 50, "等腰三角形"}, {50, 50, 50, "等边三角形"} , {50, 99, 50, "等腰三角形"},
                    {50, 100, 50, "非三角形"}, {50, 101, 50, "输入错误"}, {0, 50, 50, "输入错误"}, {1, 50, 50, "等腰三角形"}, {2, 50, 50, "等腰三角形"},
                    {50, 50, 50, "等边三角形"}, {99, 50, 50, "等腰三角形"}, {100, 50, 50, "非三角形"}, {101, 50, 50, "输入错误"}};
            return Arrays.asList(object);
        }

        @Test
        public void TriangleTest() {
            Triangle triangle = new Triangle();
            String type1 = triangle.classify(input1, input2, input3);
            assertEquals(type1, type);
        }
    }

